package org.example.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Data //此注解让这个类具备set get 功能
@Component //标记 可以被扫描生成bean对象
@AllArgsConstructor//生成满参数的构造方法
@NoArgsConstructor//无参数构造方法
@ConfigurationProperties(prefix ="hero")
//外部文件 根据前缀 hero来给属性赋值 注意 属性名要与 hero.XXX 相同
//这个外部文件只能以application.properties命名
public class Hero {
    private Integer id;
    private Integer age;
    private String name;
    private Date birth;
    private String[] hobby;
    private List<String> list;
    private Set<String> set;
    private Map<String, String> map;
}
